//转化省标数据内容
var pageii = null;
var baseURL = "../../";
$(function () {

})
function selectCheck(val) {
    if (val == 0) {
    	$("#u1138_state1").show()
        $("#u1138_state2").hide()
        $("#u1145_input").val("")
    }
    if (val == 1) {
    	$("#u1138_state2").hide()
    	$("#u1138_state1").hide()
    	$("#u1141_input").val("")
    	$("#u1145_input").val("")
    }
    if (val == 2) {
        $("#u1138_state2").show()
        $("#u1138_state1").hide()
        $("#u1141_input").val("")
    }
};

var vm = new Vue({
	el: '#checkapp',
	data: {
		id:'',
		user:{},
		userId:'',
		kffz:'',
		questionModifyData: {}
	},
	mounted () {
        this.getUserInfomation();
    },

    methods: {
    	
    	getUserInfomation: function() {

    		let url = baseURL;
    		url = url + "business/supervise/getUserInfomation";
    		$.ajax({
                type: "GET",
                url: url,
                //data:params,
                contentType: "application/json",
                success: function (res) {
                    if (res.code === '0') {
                    	debugger;
                        vm.user = res.userInfo;
                        vm.userId = res.userId;
                    } else {
                        alert(res.msg);
                    }
                }
            });
    	},
    	//check分值
    	checkData(value) {
    	    let val = event.target.value.trim()
            // 只能是正整数或空,可根据需求修改正则
            if (/^[1-9]\d*$|^$/.test(val)) {
            	if (eval(val) > eval(5)) {
            		event.target.value = 5
            	} else if (eval(val) < eval(1)) {
            		event.target.value = 1
            	} else {
            		event.target.value = val
            	} 
            } else {
                event.target.value = ''
            }
    	}, 
    	
    	updateQuestionModify() {
    		let id = $("#questionModifyId").val();
    		let checkResult = $("#checkResult").val();
    		if(checkResult == '0'){//考核扣分
    		    if($("#u1141_input").val() == '' || $("#u1141_input").val() == null){
    		        layer.msg("请输入扣分分值");
    		        return;
    		    }
    		} else if (checkResult == '1'){//不予处理

    		}else if (checkResult == '2'){//其他
    		    if($("#u1145_input").val() == '' || $("#u1145_input").val() == null){
                    layer.msg("请描述审核结果!");
                    return;
                }
    		}
    		let kffz = $("#u1141_input").val();
    		let qt = $("#u1145_input").val();
    		let checkStatus = $("#checkStatus").val();
    		let shsj = $("#u1122_shsj").text();
    		let params = {
    		    id:id,
    			checkResult: checkResult,
    			kffz:kffz,
    			checkResultDetail:qt,
    			checkStatus:checkStatus,
    			shsj:shsj
            }
    		let url = baseURL;
    		url = url + "business/supervisequestionmodify/updateById";
    		$.ajax({
                type: "GET",
                url: url,
                data:params,
                contentType: "application/json",
                success: function (res) {
                    if (res.code === '0') {
                    	//debugger;
                    	alert('操作成功', function(index){
                    		parent.location.reload();
						});
                    } else {
                        alert(res.msg);
                    }
                }
            });
    	},
    
    }
	

	
});

